<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">  

    <h:head>  
        <script type="text/javascript">
            function handleLoginRequest(xhr, status, args) {
                if (args.validationFailed || !args.loggedIn) {
                    dlg.jq.effect("shake", {times: 5}, 100);
                }
                else {
                    dlg.hide();
                    $('#loginLink').fadeOut();
                }
            }
        </script>  
    </h:head>  

    <h:body> 
        <ui:include src="../template/encabezado.xhtml"/>        
        <p:panel  header="Login">
                <h:panelGrid columns="2" cellpadding="5" >  
                    <h:outputLabel for="username" value="Usuario" />  
                    <p:inputText value="#{loginBean.username}"   
                                 id="username" required="true" label="username" />  

                    <h:outputLabel for="password" value="Contraseña" />  
                    <h:inputSecret value="#{loginBean.password}"   
                                   id="password" required="true" label="password"/>  

                    <f:facet name="footer">  
                        <p:commandButton id="loginButton" value="Login"    
                                         actionListener="#{loginBean.login}"   
                                         oncomplete="handleLoginRequest(xhr, status, args)"/>  
                    </f:facet>  
                </h:panelGrid>  
        </p:panel>
         <ui:include src="../template/foot.xhtml"/> 
    </h:body>  
</html> 